package com.school.campus.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.school.common.annotation.Excel;
import com.school.common.core.domain.BaseEntity;

/**
 * 评论对象 comment
 *
 * @author wwj
 * @date 2025-11-03
 */
public class Comment extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID，自增
     */
    private Long id;

    /**
     * 评论人昵称
     */
    @Excel(name = "评论人昵称")
    private String commentator;

    /**
     * 评论人头像URL
     */
    @Excel(name = "评论人头像URL")
    private String avatar;

    /**
     * 评论人地区
     */
    @Excel(name = "评论人地区")
    private String region;

    /**
     * 评论内容
     */
    @Excel(name = "评论内容")
    private String content;

    /**
     * 评论时间（精确到秒）
     */
    @Excel(name = "评论时间", readConverterExp = "精=确到秒")
    private Date commentTime;

    /**
     * 所属帖子ID，关联post表的id
     */
    @Excel(name = "所属帖子ID，关联post表的id")
    private Long postId;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setCommentator(String commentator) {
        this.commentator = commentator;
    }

    public String getCommentator() {
        return commentator;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setRegion(String region) {
        this.region = region;
    }

    public String getRegion() {
        return region;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void setCommentTime(Date commentTime) {
        this.commentTime = commentTime;
    }

    public Date getCommentTime() {
        return commentTime;
    }

    public void setPostId(Long postId) {
        this.postId = postId;
    }

    public Long getPostId() {
        return postId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("commentator", getCommentator())
                .append("avatar", getAvatar())
                .append("region", getRegion())
                .append("content", getContent())
                .append("commentTime", getCommentTime())
                .append("postId", getPostId())
                .toString();
    }
}
